package com.leo.anywhereimageview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;

public class SecondActivity extends AppCompatActivity {
    private ImageView image;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        image = (ImageView) findViewById(R.id.image);
//        580,773,原始图片的宽高。如果你需要做瀑布流之类的 后台数据会给
        int pic_height = 773;
        int pic_with = 580;

        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        layoutParams.width = UIUtil.getWidth(this);
        layoutParams.height = UIUtil.getWidth(this) * pic_height / pic_with;

        Glide.with(this)
                .load(R.drawable.play_region_bg)
                .asBitmap()
                .dontAnimate()
                .into(image);

    }
}
